package org.jeecg.modules.flow.record.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.flow.record.entity.WmsDocumentTypeStatusReminder;
import org.jeecg.modules.flow.record.service.IWmsDocumentTypeStatusReminderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description: 流程配置警示提示配置
 * @Author: jeecg-boot
 * @Date: 2023-11-30
 * @Version: V1.0
 */
@Api(tags = "流程配置警示提示配置")
@RestController
@RequestMapping("/flow/wmsDocumentTypeStatusReminder")
@Slf4j
public class WmsDocumentTypeStatusReminderController extends JeecgController<WmsDocumentTypeStatusReminder, IWmsDocumentTypeStatusReminderService> {
    @Autowired
    private IWmsDocumentTypeStatusReminderService wmsDocumentTypeStatusReminderService;

    /**
     * 流程配置警示提示配置-分页列表查询
     *
     * @return
     */
    //@AutoLog(value = "流程配置警示提示配置-分页列表查询")
    @ApiOperation(value = "流程配置警示提示配置-分页列表查询", notes = "流程配置警示提示配置-分页列表查询")
    @GetMapping(value = "/list")
    public Result<List<WmsDocumentTypeStatusReminder>> queryList(@RequestParam(value = "statusId") String statusId) {

        return Result.OK(wmsDocumentTypeStatusReminderService.listByStatusId(statusId));
    }

    /**
     * 编辑
     *
     * @param wmsDocumentTypeStatusReminder
     * @return
     */
    @AutoLog(value = "流程配置警示提示配置-编辑")
    @ApiOperation(value = "流程配置警示提示配置-编辑", notes = "流程配置警示提示配置-编辑")
//    @RequiresPermissions("flow:wms_document_type_status_reminder:edit")
    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
    public Result<String> edit(@RequestBody List<WmsDocumentTypeStatusReminder> wmsDocumentTypeStatusReminders) {
        wmsDocumentTypeStatusReminderService.updateList(wmsDocumentTypeStatusReminders);
        return Result.OK("保存成功!");
    }
}
